package com.zzu.service;

import com.zzu.dao.IManagerDao;
import com.zzu.model.Manager;
import com.zzu.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

public class ManagerService {

    //获得管理员账号
    public Manager findManager(String id, String password){
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        IManagerDao managerDao = sqlSession.getMapper(IManagerDao.class);
        return managerDao.findManager(id,password);
    }

    //获得id获得管理员账号
    public Manager findManagerById(String id){
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        IManagerDao managerDao = sqlSession.getMapper(IManagerDao.class);
        return managerDao.findManagerById(id);
    }

}
